package stream;

import utils.Print;

import java.util.Arrays;

public class ArrayUpcase {
    public static String[] upcaseNormal(String[] input){
        String[] result = new String[input.length];

        for(int i = 0; i < input.length; i++){
            result[i] = input[i].toUpperCase();
        }

        return result;
    }

    public static String[] upcaseStream(String[] input){
        return Arrays.stream(input)
                .map(String::toUpperCase)
                .toArray(String[]::new);
    }

    public static void main(String[] args){
        String[] test = {"hello", "world"};

        Print.printArray(upcaseNormal(test));

        Print.printArray(upcaseStream(test));
    }
}
